package cn.mux.jdk8.stream;

import java.util.Collection;
import java.util.HashSet;

public class CollectionStream {
	public static void main(String[] args) {
		Collection<String> books = new HashSet<>();
		books.add("轻量级java EE 企业级应用");
		books.add("疯狂java讲义");
		books.add("疯狂ios讲义");
		books.add("疯狂ajax讲义");
		books.add("疯狂android讲义");
		books.forEach(System.out::println);
		
		System.out.println(books.stream().filter(str->str.contains("java")).count());
		System.out.println(books.stream().filter(str->str.length()>10).count());
				books.stream().mapToInt(
						ele->((String)ele).length()
						).forEach(System.out::println);
	
	}
}
